package com.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller //可以返回JSON数据
public class IndexController {


    @RequestMapping("/index")
    @ResponseBody
    public String index(){
        return "Hello Spring boot!";
    }


    @RequestMapping(value = {"/", "/home"}, method = RequestMethod.GET)
    public String homePage(){
        return "home";
    }

    @RequestMapping(value = "/hello", method = RequestMethod.GET)
    public String hello(){
        return "hello";
    }

}
